<template>
  <el-container style="height: 100vh;">
    <el-aside :width="collapsed ? '64px' : '200px'" style="background-color: #0f172a;">
      <el-menu
        default-active="1"
        class="el-menu-vertical-demo"
        :collapse="collapsed"
        background-color="#0f172a"
        text-color="#fff"
        active-text-color="#409eff"
        router
      >
        <el-menu-item index="/employees">
          <el-icon><user /></el-icon>
          <span>员工列表</span>
        </el-menu-item>
        <el-menu-item index="/employees/add">
          <el-icon><user-plus /></el-icon>
          <span>添加员工</span>
        </el-menu-item>
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="background-color: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 20px;">
        <div style="display: flex; justify-content: space-between; align-items: center; height: 100%;">
          <el-button @click="collapsed = !collapsed" icon="menu" circle></el-button>
          <h1 style="margin: 0; font-size: 20px;">员工管理系统</h1>
          <div></div>
        </div>
      </el-header>

      <el-main style="padding: 20px;">
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup>
import { ref } from 'vue'
</script>


<style scoped>
.el-header {
  height: 60px !important;
}

.el-aside {
  overflow: hidden;
  transition: width 0.3s;
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
}
</style>